﻿<Window x:Class="WpfApplication6.View.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:viewModel="clr-namespace:WpfApplication6.ViewModel"
        xmlns:view="clr-namespace:WpfApplication6.View"
        Title="{Binding Path=DisplayText}" Height="350" Width="525">

    <Window.Resources>
        <DataTemplate DataType="{x:Type viewModel:CommandViewModel}">
            <Button Content="{Binding Path=DisplayText}" Command="{Binding Path=Command}" />
        </DataTemplate>

        <DataTemplate DataType="{x:Type viewModel:ProductsViewModel}">
            <view:ProductsView />
        </DataTemplate>

    </Window.Resources>

    <Grid>
        <StackPanel Orientation="Horizontal">
            <StackPanel Orientation="Vertical">
                <ItemsControl ItemsSource="{Binding Path=Commands}" />
            </StackPanel>
            <HeaderedContentControl Header="{Binding Path=MainPanel.DisplayText}" Content="{Binding Path=MainPanel}" />
        </StackPanel>
    </Grid>
</Window>